package com.schoolcloud.files.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Data;

/**
 * 文件分块表
 * @TableName file_chunk
 */
@TableName(value ="file_chunk")
@Data
public class FileChunk implements Serializable {
    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 关联文件主表ID
     */
    @TableField(value = "file_id")
    private Long fileId;

    /**
     * 分块序号
     */
    @TableField(value = "chunk_index")
    private Integer chunkIndex;

    /**
     * 分块大小（字节）
     */
    @TableField(value = "chunk_size")
    private Long chunkSize;

    /**
     * 分块MD5哈希值
     */
    @TableField(value = "chunk_md5")
    private String chunkMd5;

    /**
     * 分块存储路径
     */
    @TableField(value = "storage_path")
    private String storagePath;

    /**
     * 上传状态：0-未上传 1-已上传
     */
    @TableField(value = "upload_status")
    private Integer uploadStatus;

    /**
     * 上传完成时间
     */
    @TableField(value = "upload_time")
    private LocalDateTime uploadTime;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    private LocalDateTime updateTime;

    @Serial
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}
